<?php $this->pageTitle = Yii::app()->user->name; ?>
<div class="c_body">
	<div class="u_tabs">
		<div class="u_tabs_head ajaxLinks">
			<div class="u_tab curr">Личные данные</div>
			<a class="u_tab" id="u_search_tab2" href="<?php echo Yii::app()->createUrl("profile/settingsGeneral",array('id'=>$_GET['id'])); ?>">Общее</a>
			<a class="u_tab" id="u_search_tab3" href="<?php echo Yii::app()->createUrl("profile/settingsPrivacy",array('id'=>$_GET['id'])); ?>">Приватность</a>
			<a class="u_tab" id="u_search_tab4" href="<?php echo Yii::app()->createUrl("profile/settingsAlert",array('id'=>$_GET['id'])); ?>">Оповещения</a>
			<a class="u_tab" id="u_search_tab5" href="<?php echo Yii::app()->createUrl("profile/BlackList",array('id'=>$_GET['id'])); ?>">Черный список</a>
		</div>
	</div>
	<div class="clearfix">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'groups-form',
			'enableAjaxValidation'=>false,
			'htmlOptions'=>array('rel' =>Yii::app()->createUrl('profile/index', array('id'=>Yii::app()->request->getParam('id')))),
		)); ?>
		
			<?php echo $form->errorSummary($model); ?>
		
			
			<table class="flds_form">
				<!-- Основное -->
				<tr>
					<td>
						<div class="u_cat also">
							<div class="u_cat_head_strip"></div>
							<div class="u_cat_head"><span>Основное</span></div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'first_name'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'first_name',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'first_name'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'last_name'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'last_name',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'last_name'); ?>
						</div>
					</td>
				</tr>
				
				
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'love_status'); ?>
					</td>
					<td class="flds_form_r">
						<div class="select_block long">
							<?php $name = $model->sex == 'M' ? 'name_m' : 'name_w'; ?>
							<?php echo $form->dropDownList($model, 'love_status', CSelect::items('LoveStatus', $name), array('empty'=>'(Семейное положение)'));?>
							<?php echo $form->error($model,'love_status'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'birthday'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php                    
									$this->widget('zii.widgets.jui.CJuiDatePicker', array(
									    'name'=>'birthday',
							       		'language'=>'ru',
							       		'model' => $model,
							       		'attribute' => 'birthday',
									    // additional javascript options for the date picker plugin
									    'options'=>array(
									        'showAnim'=>'fold',
								    		'dateFormat'=>'yy-mm-dd',
									    ),
									    'htmlOptions'=>array(
									        //'style'=>'height:20px',
									        'class'=>'settings_fld', 
									        'size'=>60,
									        'maxlength'=>255,
									    	'value'=>($model->birthday > 0) ? $model->birthday : '',
									    ),
									));                          
						        ?> 
								
							</div>
							<?php echo $form->error($model,'birthday'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'language'); ?>
					</td>
					<td class="flds_form_r">
						<div class="select_block long">						
							<?php echo $form->dropDownList($model,'language',CSelect::items('Languages'),  array('empty' => ('Выберите страну'))); ?>						
							<?php echo $form->error($model,'language'); ?>
						</div>
					</td>
				</tr>

				<!-- Контакты -->
				<tr>
					<td>
						<div class="u_cat also">
							<div class="u_cat_head_strip"></div>
							<div class="u_cat_head"><span>Контакты</span></div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'country_id'); ?>
					</td>
					<td class="flds_form_r">
						<div class="select_block long">						
							<?php echo $form->dropDownList($model,'country_id',CSelect::items('Country'),  array('empty' => ('Выберите страну'))); ?>						
							<?php echo $form->error($model,'country_id'); ?>
						</div>
					</td>
				</tr>

				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'city'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'city',array('class'=>'settings_fld','size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'city'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'address'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'address',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'address'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'phone'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'phone',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'phone'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'skype'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'skype',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'skype'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'website'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'website',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'website'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'blog'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'blog',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'blog'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'youtube'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textField($model,'youtube',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'youtube'); ?>
						</div>
					</td>
				</tr>
			
				<!-- Образование и работа -->
				<tr>
					<td>
						<div class="u_cat also">
							<div class="u_cat_head_strip"></div>
							<div class="u_cat_head"><span>Образование и работа</span></div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'teach'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'teach',array('class'=>'settings_fld','size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'teach'); ?>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'work'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'work',array('class'=>'settings_fld','size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'work'); ?>
						</div>
					</td>
				</tr>	
			
				<!-- Интересы -->
				<tr>
					<td>
						<div class="u_cat also">
							<div class="u_cat_head_strip"></div>
							<div class="u_cat_head"><span>Интересы</span></div>
						</div>
					</td>
				</tr>
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'about'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'about',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'about'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'interests'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'interests',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'interests'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'favorite_music'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'favorite_music',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'favorite_music'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'favorite_film'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'favorite_film',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'favorite_film'); ?>
						</div>
					</td>
				</tr>	
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'favorite_book'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'favorite_book',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'favorite_book'); ?>
						</div>
					</td>
				</tr>		
				<tr>
					<td class="flds_form_l">
						<?php echo $form->labelEx($model,'favorite_game'); ?>
					</td>
					<td class="flds_form_r">
						<div class="flds_border">
							<div class="flds_border_inside">
								<?php echo $form->textArea($model,'favorite_game',array('class'=>'settings_fld', 'size'=>60,'maxlength'=>255)); ?>
							</div>
							<?php echo $form->error($model,'favorite_game'); ?>
						</div>
					</td>
				</tr>																																													
			</table>
			<?php echo CHtml::submitButton($model->isNewRecord ? 'Добавить сообщество' : 'Сохранить изменения', array('class'=>'green_btn tac')); ?>
		<?php $this->endWidget(); ?>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$.datepicker.regional['ru'] = { 
		closeText: 'Закрыть', 
		prevText: '&#x3c;Пред', 
		nextText: 'След&#x3e;', 
		currentText: 'Сегодня', 
		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', 
		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], 
		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', 
		'Июл','Авг','Сен','Окт','Ноя','Дек'], 
		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], 
		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], 
		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], 
		dateFormat: 'dd.mm.yy', 
		firstDay: 1, 
		isRTL: false 
	};
	$.datepicker.setDefaults($.datepicker.regional['ru']); 
	//$('#birthday').datepicker( "option", $.datepicker.regional['ru'] );
	$('#birthday').datepicker({ dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true, yearRange : 'c-65:nn' });
});
</script>